﻿<%@ WebHandler Language="C#" Class="city" %>

using System;
using System.Web;
using LP580.CG;
using System.Data;

public class city : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/plain";
        context.Response.ContentType = "text/plain";
        int key = Utils.RF_int("c");
        if (key != 0)
        {
            DataTable dt = area.GetCity(key).Tables[0];
            int r = dt.Rows.Count;
            if (r > 0)
            {
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                foreach (DataRow dr in dt.Rows)
                {
                    sb.AppendFormat("<option value='{0}'>{1}</option>", dr["id"], dr["name"]);
                }
                context.Response.Write(sb.ToString());
                context.Response.End();
            }
        }
    }
    public bool IsReusable {
        get {
            return false;
        }
    }

}